package office.action.finance;

import java.util.ArrayList;
import java.util.List;
import javax.annotation.Resource;
import office.action.finance.wrapper.PayMoneyWrapper;
import office.bo.person.Trip;
import office.service.finance.IPayMoneyService;
import org.apache.struts2.convention.annotation.Action;
import org.apache.struts2.convention.annotation.Namespace;
import org.apache.struts2.convention.annotation.ParentPackage;
import org.apache.struts2.convention.annotation.Result;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;

import platform.common.action.BaseAction;
@Namespace("/payMoney")
@ParentPackage("struts-base")
@Controller("payMoneyAction")
@Scope("prototype")
public class PayMoneyAction extends BaseAction{

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	@Resource
	IPayMoneyService payMoneyService;
	
	private PayMoneyWrapper payMoneyWrapper = new PayMoneyWrapper();
	
	private String state;
	
	private List<PayMoneyWrapper> payMoneyList = new ArrayList<PayMoneyWrapper>();
	
	@Action(value="getAllPayMoney",results={@Result(location="/pages/finance/payMoney/payMoney.jsp")})
	public String getAllPayMoney(){
		payMoneyList = payMoneyService.getAllPayMoney(state);
		return "success";
	}
	
	@Action(value="gotoPayMoneyMenu",results={@Result(location="/pages/finance/payMoney/payMoneyXml.jsp")})
	public String gotoPayMoneyMenu(){
		return "success";
	}
	
	@Action(value="gotoPayMoneyChangeXml",results={@Result(location="/pages/finance/payMoney/payMoneyChangeXml.jsp")})
	public String gotoPayMoneyChangeXml(){
		return "success";
	}
	
	@Action(value="doPayMoney")
	public String doPayMoney(){
		Trip trip = new Trip();
		trip.setId(payMoneyWrapper.getId());
		trip.setState("110");
		payMoneyService.doPayMoney(trip);
		this.getAjaxMessagesJson().setMessage(true, "", "付款成功！");
		return RESULT_AJAXJSON;
	}

	public IPayMoneyService getPayMoneyService() {
		return payMoneyService;
	}

	public void setPayMoneyService(IPayMoneyService payMoneyService) {
		this.payMoneyService = payMoneyService;
	}

	public List<PayMoneyWrapper> getPayMoneyList() {
		return payMoneyList;
	}

	public void setPayMoneyList(List<PayMoneyWrapper> payMoneyList) {
		this.payMoneyList = payMoneyList;
	}

	public PayMoneyWrapper getPayMoneyWrapper() {
		return payMoneyWrapper;
	}

	public void setPayMoneyWrapper(PayMoneyWrapper payMoneyWrapper) {
		this.payMoneyWrapper = payMoneyWrapper;
	}

	public String getState() {
		return state;
	}

	public void setState(String state) {
		this.state = state;
	}
	

	 
	
}
